﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Go.Model;
using Go.Tools;
namespace GoUnitTest
{

    public class MockHumanPayerNullMovement: HumanPlayer
    {
        LinkedList<Position> _listCoordinatesToPlay;

        public LinkedList<Position> ListCoordinatesToPlay
        {
            get { return _listCoordinatesToPlay; }
            set { _listCoordinatesToPlay = value; }
        }

        public MockHumanPayerNullMovement(Color aColor, String name): base(aColor, name)
        {
            _listCoordinatesToPlay = null;
        }

        public MockHumanPayerNullMovement(LinkedList<Position> aListCoordinateToPlay, Color aColor, String name)
            : base(aColor, name)
        {
            _listCoordinatesToPlay = aListCoordinateToPlay;
        }

        public override void play() {
            if (_listCoordinatesToPlay == null)
            {
                HasMadeAFirstMove = true;
                this.LastPlayed = null;
            } else {
                if (_listCoordinatesToPlay.Count == 0)
                {
                    HasMadeAFirstMove = true;
                    this.LastPlayed = null;
                    return ;
                }
                Position aPositioToPlay = _listCoordinatesToPlay.First.Value;
                _listCoordinatesToPlay.RemoveFirst();
                if (aPositioToPlay!=null)
                    this.putStone(aPositioToPlay);
            }

        }



    
    }
}
